package com.itheima.jianbing3;

import com.itheima.jianbing2.Desk;

import java.util.concurrent.ArrayBlockingQueue;

public class Test {

    public static void main(String[] args) throws InterruptedException {
        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(3);
        Cooker cooker = new Cooker(queue);
        Thread t1 = new Thread(cooker);
        Foodie foodie = new Foodie(queue);
        Thread t2 = new Thread(foodie);
        t2.setName("小蔡");
        Foodie foodie2 = new Foodie(queue);
        Thread t3 = new Thread(foodie2);
        t3.setName("周琦");
        t1.start();

        t2.start();
      t3.start();



    }
}
